{% extends "base_site.html" %}
{% load i18n %}
{% load tabind %}

{% block extrastyle %}
    <link rel="stylesheet" type="text/css" href="/static/css/forms.css" />
    <script type="text/javascript" src="{% url "django.views.i18n.javascript_catalog" %}"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.js"></script>
    <script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
    <script type="text/javascript" src="/static/admin/js/core.js"></script>
    <script type="text/javascript" src="/static/admin/js/calendar.js"></script>
    <script type="text/javascript" src="/static/admin/js/admin/DateTimeShortcuts.js"></script>
{% endblock %}

{% block content_title %}
<h2>{{ content_title }}</h2>
{% endblock %}
{% block content %}
  <div id="content-main">
    <form action="/search/" method="get">{% csrf_token %}
      <ul class="searchlist">
        {{ form.as_ul }}
        <li><input type="submit" value="Details" name="add-details" /></li>
        {% if mform %}
          {{ mform.as_ul }}
        {% endif %}
      </ul>
      <div>
          <input type="submit" value="Search" name="search" />
          <input type="submit" value="Details" name="add-details" />
      </div>
    </form>
    {% if data_list %}
      <form action="/adddesktop/DeskTop/" method="post">{% csrf_token %}
        <table>
          <tr>
            <th>Data</th>
            <th><input type="submit" name="add_obj_on_desktop" value="Add to DeskTop" /></th>
          </tr>
          {% for dt in data_list %}
          <tr>
            <td><a href="/base/{{dt.0.id}}">{{dt.0}}</a></td>
            {% ifequal dt.1 "checkbox" %}
            <td><input type="checkbox" name="obj_{{ dt.0.id }}" value="{{ dt.0.id }}" /></td>
            {% else %}
            <td>{{ dt.1 }}</td>
            {% endifequal %}
          </tr>
          {% endfor %}
          <tr>
            <th></th>
            <th><input type="submit" name="add_obj_on_desktop" value="Add to DeskTop" /></th>
          </tr>
        </table>
      </form>
    {% endif %}
  </div>
{% endblock %}

